Part Number Hot Search : 
MBT22 SCN2674T 406C34 LV5781 FXT449SM JRC455 C0603X A5800952
Product Description
Full Text Search
 

To Download PLSM-CSC Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 (R)
RGB2YCrCb & YCrCb2RGB
Color Space Converters
Data Sheet
February 1997, ver. 1
Features
s s s s s s s
RGB2YCrCb and YCrCb2RGB MegaCore functions converting digital video colors to television broadcast signal colors and vice versa Optimized for the FLEX(R) 10K and FLEX 8000 device architectures 24-bit RGB2YCrCb and YCrCb2RGB color space conversion High-speed operation (100 MHz) Supported by MAX+PLUS(R) II software Full precision outputs: rounding and saturation can be performed with the round and saturate reference designs Useful for a variety of applications, including image filtering, machine vision, and digital video
General Description
The RGB2YCrCb and YCrCb2RGB color space converter functions are useful for a number of image processing and filtering operations. The RGB2YCrCb function converts red-green-blue (RGB) color space to the YCrCb (intensity-color red-color blue) color space; the YCrCb2RGB function performs the inverse operation. Figure 1 shows the symbols for the RBG2YCrCb and YCrCb2RGB functions.
Figure 1. RGB2YCrCb & YCrCb2RGB Symbols
RGB2YCRCB
R[7..0] G[7..0] B[7..0] CLK ACLR Y[15..0] CB[14..0] CR[14..0] Y[7..0] CB[7..0] CR[7..0] CLK ACLR R[16..0] G[16..0] B[16..0]
YCRCB2RGB
Altera Corporation
A-DS-RGB-01
1
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
Function Prototypes
The Altera Hardware Description Language (AHDL) Function Prototype of the RGB2YCrCb function is shown below:
FUNCTION RGB2YCrCb (r[7..0], g[7..0], b[7..0], clk, aclk) RETURNS (y[15..0], cb[14..0], cr[14..0]);
The AHDL Function Prototype of the YCrCb2RGB function is shown below:
FUNCTION YCrCb2RGB (y[7..0], cb[7..0], cr[7..0], clk, aclr) RETURNS (r[16..0], g[16..0], b[16..0]);
Ports
Table 1 describes the input and output ports for the RGB2YCrCb function.
Table 1. RGB2YCrCb Ports
Name Type Numbering Representation
Note (1)
r[7..0] g[7..0] b[7..0] clk aclr y[15..0] cb[14..0] cr[14..0] Note:
(1) The notation x.y represents x bits to the left of the radix point, and y bits to the right.
Description
Input Input Input Input Input Output Output Output
Unsigned 8.0 Unsigned 8.0 Unsigned 8.0 - - Unsigned 8.8 Unsigned 8.7 Unsigned 8.7
Red data Green data Blue data Clock Asynchronous clear Intensity data Color blue data Color red data
2
Altera Corporation
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
Table 2 describes the input and output ports for the YCrCb2RGB function.
Table 2. YCrCb2RGB Ports
Name Type Numbering Representation
Note (1)
y[7..0] cb[7..0] cr[7..0] clk aclr r[16..0] g[16..0] b[16..0] Note:
(1) Signed refers to two's compliment signed. The notation x.y represents x bits to the left of the radix point, and y bits to the right. The RGB values may be negative if the YCrCb values deviate outside the nominal range. For more control over the values, rounding and saturation functions are available.
Description
Input Input Input Input Input Output Output Output
Unsigned 8.0 Unsigned 8.0 Unsigned 8.0 - - Signed 10.7 Signed 10.7 Signed 10.7
Intensity data Color blue data Color red data Clock Asynchronous clear Red data Green data Blue data
Functional Description
The RGB2YCrCb function uses the following equations when converting gamma-corrected RGB data to YCrCb data: Y' = 0.257R' + 0.504G' + 0.098B' + 16 Cr = 0.439R' - 0.368G' - 0.071B' + 128 Cb = -0.148R' - 0.291G' + 0.439B' + 128 The YCrCb2RGB function uses the following equations when converting YCrCb data to RGB data: R' = 1.164(Y'- 16) + 1.596(Cr - 128) G' = 1.164(Y'- 16) - 0.813(Cr - 128) - 0.392(Cb - 128) B' = 1.164(Y'- 16) + 2.017(Cb - 128) 1 Refer to Video Demystified for more information on these equations (see "References" for details).
Because the inputs are multiplied by constant values, the look-up table (LUT) architecture of the FLEX 10K and FLEX 8000 devices is ideal for efficiently performing the conversion equations.
Altera Corporation
3
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
Some of the coefficients are smaller in magnitude, and therefore the multiplier only has to be as large as the equivalent number of binary digits in the coefficient. For example in the Y' equation, when multiplying the 8-bit input (b[7..0]) by 0.09810 (or 0.000110012), only a 5 x 8-bit multiplier is required instead of an 8 x 8 bitmultiplier. The y output of the RGB2YCrCb function is an unsigned 16-bit binary number with 8 bits to the left of the radix point and 8 bits to the right. To convert the y output to an 8-bit binary number, the value must be rounded.
f
For more information on data word rounding, refer to Functional Specification 5 (round Data Word Rounder). Figure 2 shows the block diagram of the Y' component of the RGB2YCrCb function. The Cr and Cb components of the conversion are calculated in a similar manner.
Figure 2. RGB2YCrCb Converter Block Diagram
b[7..0] g[7..0] r[7..0]
0.257 7 15 8
8
8 0.504 8 16 0.098 5 13
16 16 16
y[15..0]
4
Altera Corporation
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
Figure 3 shows the block diagram for the YCrCb2RGB function. The r, g, and b outputs of the YCrCb2RGB function are 17-bit two's compliment signed numbers with 10 bits to the left of the radix point and 7 bits to the right. To convert the r, g, and b outputs to 8-bit signed numbers, the data words should be saturated and rounded.
f
For more information on rounding, refer to Functional Specification 5 (round Data Word Rounder); for more information on saturation, refer to Functional Specification 6 (saturate Data Word Saturator).
Figure 3. YCrCb2RGB Converter Block Diagram
16 - y[7..0] + 8 128 - cb[7..0] 8 128 - cr[7..0] + 8 1.596 8 0.813 8 0.392 8 2.017 8 cr - 128 + cb - 128 (y - 16) 1.164 1.164(y - 16)
-
+ +
- -
+
+
17
17
17
r[16..0]
g[16..0]
b[16..0]
Altera Corporation
5
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
Digital Video System Application
Figure 4 is a simplified illustration of an 8-bit color channel in a digital video system. In this example, color space conversion is performed using the YCrCb2RGB function. Depending on the input values to the YCrCb2RGB function, the multiplication used in the color conversion may result in 17-bit data words that roll over. To avoid data word roll over, the 17-bit digital video signals are fed to the saturate function, where they are saturated to 16-bit words. The signals are then fed to the round function, where they are rounded to 8-bit words. At this point, the data words are ready for conversion to an analog video signal. For more information on data word roll over and saturating, refer to Functional Specification 6 (saturate Data Word Saturator); for more information on rounding, refer to Functional Specification 5 (round Data Word Rounder).
f
Figure 4. Digital Video Channel
r y cr cb
17 8 8 8
Saturate Function
16
Round Function
8
YCrCb2RGB g Function 17
Saturate Function
16
Round Function
8
D/A Converter
Analog Video Signal
b
17
Saturate Function
16
Round Function
8
6
Altera Corporation
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
References
Jack, Keith. Video Demystified, A Handbook for the Digital Engineer. Second Edition. Solana Beach: Hightext Publications, 1996. This book discusses fundamental computer-video applications, including color space conversion considerations such as equations, data word saturation, and data word rounding. ISBN: 1-878707-23-X (paperback edition), Library of Congress catalog card number: 96-076446.
Altera Corporation
7
RGB2YCrCb & YCrCb2RGB Color Space Converters Data Sheet
(R)
2610 Orchard Parkway San Jose, CA 95134-2020 (408) 894-7000 http://www.altera.com Applications Hotline: (800) 800-EPLD Customer Marketing: (408) 894-7104 Literature Services: (888) 3-ALTERA lit_req@altera.com 8
Printed on Recycled Paper.
Altera, FLEX, FLEX 10K, FLEX 8000, MAX, MAX+PLUS, and MAX+PLUS II are trademarks and/or service marks of Altera Corporation in the United States and other countries. Altera acknowledges the trademarks of other organizations for their respective products or services mentioned in this document. Altera products are protected under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera Corporation. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services. Copyright (c) 1997 Altera Corporation. All rights reserved.
Altera Corporation


▲Up To Search▲   

 
Price & Availability of PLSM-CSC

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X